// 用户模型
const { User } = require('../../../models/user');
// 统一数据返回类
const { DataReturn } = require('../../../common/returnclass');

module.exports = async (req, res) => {
	// 用户id 用户状态
	let { _id } = req.fields;
	console.log(req.fields);
	// 更新用户状态
	User.updateOne({ _id }, req.fields)
	.then(async (result)=>{
		DataReturn.getData(res, 200, [] , '更新成功');
	}).catch(()=>{
		DataReturn.getData(res, 400, [], '更新失败');
	})

}
